package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.project.entity.OutOrderInfo;
import com.project.entity.PreOutOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lovo
 * @since 2023-07-21
 */
@Mapper
public interface OutOrderInfoMapper extends BaseMapper<OutOrderInfo> {
    /**
     * 添加销售详情表记录
     * @param newOutOrderId 新订单ID
     * @param preOutOrderList 出库集合
     */
    public void addOutOrderInfo(@Param("newOutOrderId") Integer newOutOrderId, @Param("preOutOrderList") List<PreOutOrder> preOutOrderList);

    /**
     *按销售单ID查询销售详情
     * 处理：按销售单ID查询销售信息，同时联表查出销售商品集合
     * @param outOrderId 销售单ID
     * @return 销售单对象（销售单ID、客户名称、销售员、销售日期、订单金额（计算所得）、出库数量、销售商品集合（商品ID、厂家、成交价））
     */
    public List<OutOrderInfo> findByOutOrderId(Integer outOrderId);
}
